Skip to content

feat: mask constructor arguments during obfuscation - #150

Merged
g4titanx merged 2 commits into
masterfrom
fix/constructor-argument-obfuscation
Aug 6, 2026
Merged

feat: mask constructor arguments during obfuscation#150
g4titanx merged 2 commits into
masterfrom
fix/constructor-argument-obfuscation

Conversation

@EmperorOrokuSaki

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Decompile Diff Analysis

Statistics (50 iterations)

  • Total: 47 hunks, -141 removed, +251 added
  • Items: 17 total, 16 with changes
  • Selectors: 20 remapped
Metric Min Avg Max
Hunks 38 51.8 57
Lines removed 91 137.8 168
Lines added 220 288.7 418
Lines unchanged 97 127.2 174
Full Diff Output
─── Storage ───
@@ -1,16 +1,21 @@
-    uint256 public constant tokenContract = 0;
-    uint256 public constant expectedAmount = 0;
-    uint256 public constant unresolved_3d2691bc = 256;
-    uint256 public constant unresolved_8677ab23 = 0;
+    bool public unresolved_df4cc90b;
+    uint256 public unresolved_fc2ae0e5;
+    bytes32 store_o;
+    bytes32 store_m;
+    bytes32 store_p;
+    bytes32 store_j;
+    bytes32 store_k;
+    bytes32 store_a;
+    uint256 public unresolved_94c7edfd;
+    address public unresolved_183a7a1d;
+    uint256 store_e;
+    bytes32 store_i;
+    uint256 public unresolved_a0e8ade5;
+    bytes32 store_l;
+    bytes32 store_n;
+    bytes32 store_q;
+    bytes32 store_r;
+    uint256 public unresolved_40ee8d4a;
     
-    uint256 public unresolved_8bd03d0a;
-    uint256 public executionDeadline;
-    uint256 public bondAmount;
-    bool public unresolved_308657d7;
-    uint256 public totalBondsDeposited;
-    uint256 public unresolved_d415b3f9;
-    uint256 public currentRewardAmount;
-    address public unresolved_1aa7c0ec;
-    
-    error InvalidRLPList();
+    error CustomError_00000000();
     

─── Function Unresolved_ede7f6a3 (0xede7f6a3 → 0xa518f6d4) ───
@@ -1,77 +1,80 @@
-    /// @custom:selector    0xede7f6a3
-    /// @custom:signature   Unresolved_ede7f6a3(uint256 arg0, uint256 arg1) public view
+    
+    /// @custom:selector    0xa518f6d4
+    /// @custom:signature   Unresolved_a518f6d4(uint256 arg0, uint256 arg1) public view
     /// @param              arg0 ["uint256", "bytes32", "int256"]
     /// @param              arg1 ["uint256", "bytes32", "int256"]
-    function Unresolved_ede7f6a3(uint256 arg0, uint256 arg1) public view {
+    function Unresolved_a518f6d4(uint256 arg0, uint256 arg1) public view {
+        require(0xf6 == msg.data[0]);
+        require(0 == 0x01);
         require(msg.value);
         require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0x40);
         require(arg0 > 0xffffffffffffffff);
         require(((msg.data.length - arg0) + 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc) < 0xa0);
         require(arg0 + (arg0) > 0xffffffffffffffff);
-        require(!(bytes1(unresolved_308657d7 >> 0x08)), CustomError_ded7c80c());
-        require(msg.sender == (address(unresolved_1aa7c0ec)), CustomError_ded7c80c());
-        require(!(msg.sender == (address(unresolved_1aa7c0ec))), CustomError_ded7c80c());
-        var_a = 0xded7c80c00000000000000000000000000000000000000000000000000000000;
+        require(!(bytes1(unresolved_df4cc90b >> 0x08)), CustomError_212837f4());
+        require(msg.sender == (address(unresolved_183a7a1d)), CustomError_212837f4());
+        require(!(msg.sender == (address(unresolved_183a7a1d))), CustomError_212837f4());
+        var_a = 0x212837f400000000000000000000000000000000000000000000000000000000;
         require(arg1 > block.number, CustomError_58968cf0());
         var_a = 0x58968cf000000000000000000000000000000000000000000000000000000000;
-        require((block.number - arg1) > block.number, CustomError_c42a0185());
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        require((block.number - arg1) > block.number, CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_b = 0x11;
         require((block.number - arg1) > 0x0100, CustomError_c42a0185());
         var_a = 0xc42a018500000000000000000000000000000000000000000000000000000000;
-        require(!blockhash(arg1), CustomError_31aed5c2());
-        require(arg0 + (arg0) > 0xffffffffffffffff, CustomError_31aed5c2());
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        require(!blockhash(arg1), CustomError_b1b7848f());
+        require(arg0 + (arg0) > 0xffffffffffffffff, CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_b = 0x41;
-        require(((var_c + (uint248((0x20 + (0x1f + (arg0 + (arg0)))) + 0x1f))) > 0xffffffffffffffff) | ((var_c + (uint248((0x20 + (0x1f + (arg0 + (arg0)))) + 0x1f))) < var_c), CustomError_31aed5c2());
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        require(((var_c + (uint248((0x20 + (0x1f + (arg0 + (arg0)))) + 0x1f))) > 0xffffffffffffffff) | ((var_c + (uint248((0x20 + (0x1f + (arg0 + (arg0)))) + 0x1f))) < var_c), CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_b = 0x41;
         uint256 var_c = var_c + (uint248((0x20 + (0x1f + (arg0 + (arg0)))) + 0x1f));
         uint256 var_d = (arg0 + (arg0));
         var_e = msg.data[36:36];
         uint256 var_f = 0;
-        require(keccak256(var_e) - blockhash(arg1), CustomError_31aed5c2());
-        require(!(arg0 + (arg0)), CustomError_31aed5c2());
-        require(bytes1(0x20 + (arg0 + (arg0))) < 0xc000000000000000000000000000000000000000000000000000000000000000, CustomError_31aed5c2());
-        require(!(arg0 + (arg0)), CustomError_31aed5c2());
-        require(bytes1(0x20 + (arg0 + (arg0))) < 0xf800000000000000000000000000000000000000000000000000000000000000, CustomError_31aed5c2());
-        require(!(0 < (arg0 + (arg0))), CustomError_31aed5c2());
-        require((bytes1(((0x20 + (arg0 + (arg0))) + 0) >> 0xf8) + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff09) > 0xff, CustomError_31aed5c2());
-        require((0x01 + (bytes1((((0x20 + (arg0 + (arg0))) + 0) >> 0xf8) + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff09))) > 0xff, CustomError_31aed5c2());
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        require(keccak256(var_e) - blockhash(arg1), CustomError_b1b7848f());
+        require(!(arg0 + (arg0)), CustomError_b1b7848f());
+        require(bytes1(0x20 + (arg0 + (arg0))) < 0xc000000000000000000000000000000000000000000000000000000000000000, CustomError_b1b7848f());
+        require(!(arg0 + (arg0)), CustomError_b1b7848f());
+        require(bytes1(0x20 + (arg0 + (arg0))) < 0xf800000000000000000000000000000000000000000000000000000000000000, CustomError_b1b7848f());
+        require(!(0 < (arg0 + (arg0))), CustomError_b1b7848f());
+        require((bytes1(((0x20 + (arg0 + (arg0))) + 0) >> 0xf8) + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff09) > 0xff, CustomError_b1b7848f());
+        require((0x01 + (bytes1((((0x20 + (arg0 + (arg0))) + 0) >> 0xf8) + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff09))) > 0xff, CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_b = 0x11;
-        require(0 > (0 + (bytes1(0x01 + ((((0x20 + (arg0 + (arg0))) + 0) >> 0xf8) + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff09)))), CustomError_31aed5c2());
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        require(0 > (0 + (bytes1(0x01 + ((((0x20 + (arg0 + (arg0))) + 0) >> 0xf8) + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff09)))), CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_b = 0x11;
         require(!(block.chainid == 0xa5bd), CustomError_31aed5c2());
         require(block.chainid == 0xa5bd, CustomError_31aed5c2());
         require(0 < 0x03, CustomError_31aed5c2());
         require(!((0 + (bytes1(0x01 + ((((0x20 + (arg0 + (arg0))) + 0) >> 0xf8) + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff09)))) < (arg0 + (arg0))), CustomError_31aed5c2());
         require(!((0 + (bytes1(0x01 + ((((0x20 + (arg0 + (arg0))) + 0) >> 0xf8) + 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff09)))) < (arg0 + (arg0))), CustomError_31aed5c2());
         var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
         var_b = 0x32;
         var_a = 0x31aed5c200000000000000000000000000000000000000000000000000000000;
         if (0 < 0x08) {
         }
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_b = 0x11;
         var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
         var_b = 0x32;
         if (!block.chainid == 0xa5bd) {
             if (block.chainid == 0xa5bd) {
                 require(!(block.chainid == 0xa5bd), CustomError_c0098bd9());
             }
             require(block.chainid == 0xa5bd, CustomError_c0098bd9());
         }
         var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
         var_b = 0x32;
         var_a = 0xc0098bd900000000000000000000000000000000000000000000000000000000;
         var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
         var_b = 0x32;
         var_a = 0xff28378700000000000000000000000000000000000000000000000000000000;
         var_a = 0xbfc9f0d300000000000000000000000000000000000000000000000000000000;
-        require(executionDeadline, CustomError_ded7c80c());
-        require(!(!block.timestamp > executionDeadline), CustomError_ded7c80c());
-        var_a = 0xded7c80c00000000000000000000000000000000000000000000000000000000;
-        var_a = 0xd5ef09ba00000000000000000000000000000000000000000000000000000000;
+        require(unresolved_40ee8d4a, CustomError_212837f4());
+        require(!(!block.timestamp > unresolved_40ee8d4a), CustomError_212837f4());
+        var_a = 0x212837f400000000000000000000000000000000000000000000000000000000;
+        var_a = 0x2a10f64600000000000000000000000000000000000000000000000000000000;
     }

─── Function withdraw (0x3ccfd60b → 0xc27ed640) ───
@@ -1,40 +1,49 @@
     
-    /// @custom:selector    0x3ccfd60b
-    /// @custom:signature   withdraw() public payable
-    function withdraw() public payable {
+    /// @custom:selector    0xc27ed640
+    /// @custom:signature   Unresolved_c27ed640(uint256 arg0) public payable returns (uint256)
+    /// @param              arg0 ["uint256", "bytes32", "int256"]
+    function Unresolved_c27ed640(uint256 arg0) public payable returns (uint256) {
+        require(0xd6 == msg.data[0]);
+        require(0 == 0x01);
+        require(0x55 == msg.data[0]);
+        require(0 == 0x01);
         require(msg.value);
         require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
-        require(!(bytes1(unresolved_308657d7 >> 0x08)), CustomError_618bbdd5());
+        uint256 var_a = 0;
+        return 0;
+        require(msg.value);
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
+        require(!(bytes1(unresolved_df4cc90b >> 0x08)), CustomError_618bbdd5());
         require(msg.sender - 0, CustomError_618bbdd5());
-        var_a = 0x618bbdd500000000000000000000000000000000000000000000000000000000;
-        require(executionDeadline, CustomError_9cbc1de1());
-        require(!(block.timestamp > executionDeadline), CustomError_9cbc1de1());
-        var_a = 0x9cbc1de100000000000000000000000000000000000000000000000000000000;
-        unresolved_1aa7c0ec = uint96(unresolved_1aa7c0ec);
-        bondAmount = 0;
-        executionDeadline = 0;
-        require(unresolved_8bd03d0a > (unresolved_8bd03d0a + unresolved_d415b3f9));
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
-        var_b = 0x11;
-        unresolved_308657d7 = uint248(unresolved_308657d7);
-        unresolved_8bd03d0a = 0;
-        currentRewardAmount = 0;
-        require(!unresolved_8bd03d0a + unresolved_d415b3f9);
-        var_c = 0xa9059cbb00000000000000000000000000000000000000000000000000000000;
+        var_b = 0x618bbdd500000000000000000000000000000000000000000000000000000000;
+        require(unresolved_40ee8d4a, CustomError_9cbc1de1());
+        require(!(block.timestamp > unresolved_40ee8d4a), CustomError_9cbc1de1());
+        var_b = 0x9cbc1de100000000000000000000000000000000000000000000000000000000;
+        unresolved_183a7a1d = uint96(unresolved_183a7a1d);
+        store_e = 0;
+        unresolved_40ee8d4a = 0;
+        require(unresolved_fc2ae0e5 > (unresolved_fc2ae0e5 + unresolved_a0e8ade5), CustomError_b1b7848f());
+        var_b = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
+        var_c = 0x11;
+        unresolved_df4cc90b = uint248(unresolved_df4cc90b);
+        unresolved_fc2ae0e5 = 0;
+        unresolved_94c7edfd = 0;
+        require(!unresolved_fc2ae0e5 + unresolved_a0e8ade5);
+        var_a = 0xa9059cbb00000000000000000000000000000000000000000000000000000000;
         address var_d = msg.sender;
-        uint256 var_e = unresolved_8bd03d0a + unresolved_d415b3f9;
+        uint256 var_e = unresolved_fc2ae0e5 + unresolved_a0e8ade5;
         (bool success, bytes memory ret0) = address(0).Unresolved_a9059cbb(var_d); // call
         require(!0, CustomError_045c4b02());
-        var_a = 0x045c4b0200000000000000000000000000000000000000000000000000000000;
-        require(0x20 > ret0.length);
-        require(((var_f + 0x20) > 0xffffffffffffffff) | ((var_f + 0x20) < var_f));
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
-        var_b = 0x41;
+        var_b = 0x045c4b0200000000000000000000000000000000000000000000000000000000;
+        require(0x20 > ret0.length, CustomError_b1b7848f());
+        require(((var_f + 0x20) > 0xffffffffffffffff) | ((var_f + 0x20) < var_f), CustomError_b1b7848f());
+        var_b = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
+        var_c = 0x41;
         uint256 var_f = var_f + 0x20;
         require(((var_f + 0x20) - var_f) < 0x20);
         require(var_f.length - var_f.length, CustomError_045c4b02());
         require(!var_f.length, CustomError_045c4b02());
-        var_a = 0x045c4b0200000000000000000000000000000000000000000000000000000000;
-        var_a = 0x53cd7f7900000000000000000000000000000000000000000000000000000000;
-        var_a = 0xd5ef09ba00000000000000000000000000000000000000000000000000000000;
+        var_b = 0x045c4b0200000000000000000000000000000000000000000000000000000000;
+        var_b = 0xfce847cf00000000000000000000000000000000000000000000000000000000;
+        var_b = 0x2a10f64600000000000000000000000000000000000000000000000000000000;
     }

─── Removed: requestCancellation (0x81972d00) ───
@@ -1,10 +1,0 @@
-    
-    /// @custom:selector    0x81972d00
-    /// @custom:signature   requestCancellation() public payable
-    function requestCancellation() public payable {
-        require(msg.value);
-        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
-        require(msg.sender - 0, CustomError_618bbdd5());
-        var_a = 0x618bbdd500000000000000000000000000000000000000000000000000000000;
-        unresolved_308657d7 = 0x01 | (uint248(unresolved_308657d7));
-    }

─── Function fund (0xa65e2cfd → 0x31949122) ───
@@ -1,41 +1,43 @@
     
-    /// @custom:selector    0xa65e2cfd
-    /// @custom:signature   fund(uint256 arg0, uint256 arg1) public payable
+    /// @custom:selector    0x31949122
+    /// @custom:signature   Unresolved_31949122(uint256 arg0, uint256 arg1) public payable
     /// @param              arg0 ["uint256", "bytes32", "int256"]
     /// @param              arg1 ["uint256", "bytes32", "int256"]
-    function fund(uint256 arg0, uint256 arg1) public payable {
+    function Unresolved_31949122(uint256 arg0, uint256 arg1) public payable {
+        require(!store_p);
+        require(0 == 0x01);
         require(msg.value);
         require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0x40, CustomError_618bbdd5());
         require(msg.sender - 0, CustomError_618bbdd5());
         var_a = 0x618bbdd500000000000000000000000000000000000000000000000000000000;
-        require(bytes1(unresolved_308657d7 >> 0x08), CustomError_5adf6387());
+        require(bytes1(unresolved_df4cc90b >> 0x08), CustomError_5adf6387());
         var_a = 0x5adf638700000000000000000000000000000000000000000000000000000000;
-        require(!arg0);
-        require(!arg1);
-        currentRewardAmount = arg0;
-        unresolved_d415b3f9 = arg0;
-        unresolved_8bd03d0a = arg1;
-        require(unresolved_d415b3f9 > (unresolved_d415b3f9 + unresolved_8bd03d0a));
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        require(!arg0, CustomError_b1b7848f());
+        require(!arg1, CustomError_b1b7848f());
+        unresolved_94c7edfd = arg0;
+        unresolved_a0e8ade5 = arg0;
+        unresolved_fc2ae0e5 = arg1;
+        require(unresolved_a0e8ade5 > (unresolved_a0e8ade5 + unresolved_fc2ae0e5), CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_b = 0x11;
         var_c = 0x23b872dd00000000000000000000000000000000000000000000000000000000;
         address var_d = msg.sender;
         address var_e = address(this);
-        uint256 var_f = unresolved_d415b3f9 + unresolved_8bd03d0a;
+        uint256 var_f = unresolved_a0e8ade5 + unresolved_fc2ae0e5;
         (bool success, bytes memory ret0) = address(0).Unresolved_23b872dd(var_d); // call
         require(!0, CustomError_045c4b02());
-        unresolved_308657d7 = (uint248(unresolved_308657d7)) | 0x0100;
+        unresolved_df4cc90b = (uint248(unresolved_df4cc90b)) | 0x0100;
         var_a = 0x045c4b0200000000000000000000000000000000000000000000000000000000;
-        require(0x20 > ret0.length);
-        require(((var_g + 0x20) > 0xffffffffffffffff) | ((var_g + 0x20) < var_g));
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        require(0x20 > ret0.length, CustomError_b1b7848f());
+        require(((var_g + 0x20) > 0xffffffffffffffff) | ((var_g + 0x20) < var_g), CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_b = 0x41;
         uint256 var_g = var_g + 0x20;
         require(((var_g + 0x20) - var_g) < 0x20);
         require(var_g.length - var_g.length, CustomError_045c4b02());
         require(!var_g.length, CustomError_045c4b02());
         var_a = 0x045c4b0200000000000000000000000000000000000000000000000000000000;
-        unresolved_308657d7 = (uint248(unresolved_308657d7)) | 0x0100;
+        unresolved_df4cc90b = (uint248(unresolved_df4cc90b)) | 0x0100;
         var_a = 0x932ca0a300000000000000000000000000000000000000000000000000000000;
         var_a = 0xea1083a700000000000000000000000000000000000000000000000000000000;
     }

─── Removed: resume (0x046f7da2) ───
@@ -1,10 +1,0 @@
-    
-    /// @custom:selector    0x046f7da2
-    /// @custom:signature   resume() public payable
-    function resume() public payable {
-        require(msg.value);
-        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
-        require(msg.sender - 0, CustomError_618bbdd5());
-        var_a = 0x618bbdd500000000000000000000000000000000000000000000000000000000;
-        unresolved_308657d7 = uint248(unresolved_308657d7);
-    }

─── Function bond (0x9940686e → 0x13e26895) ───
@@ -1,54 +1,56 @@
     
-    /// @custom:selector    0x9940686e
-    /// @custom:signature   bond(uint256 arg0) public payable
+    /// @custom:selector    0x13e26895
+    /// @custom:signature   Unresolved_13e26895(uint256 arg0) public payable
     /// @param              arg0 ["uint256", "bytes32", "int256"]
-    function bond(uint256 arg0) public payable {
+    function Unresolved_13e26895(uint256 arg0) public payable {
+        require(0x68 == msg.data[0]);
+        require(0 == 0x01);
         require(msg.value);
-        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0x20, CustomError_253ef1d2());
-        require(executionDeadline, CustomError_253ef1d2());
-        require(block.timestamp > executionDeadline, CustomError_253ef1d2());
-        require(!(bytes1(unresolved_308657d7 >> 0x08)), CustomError_253ef1d2());
-        require(bytes1(unresolved_308657d7), CustomError_253ef1d2());
-        require(executionDeadline, CustomError_253ef1d2());
-        require(!(block.timestamp > executionDeadline), CustomError_253ef1d2());
-        var_a = 0x253ef1d200000000000000000000000000000000000000000000000000000000;
-        require((currentRewardAmount >> 0x01) > arg0, CustomError_e92c469f());
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0x20, CustomError_db86cd77());
+        require(unresolved_40ee8d4a, CustomError_db86cd77());
+        require(block.timestamp > unresolved_40ee8d4a, CustomError_db86cd77());
+        require(!(bytes1(unresolved_df4cc90b >> 0x08)), CustomError_db86cd77());
+        require(bytes1(unresolved_df4cc90b), CustomError_db86cd77());
+        var_a = 0xdb86cd7700000000000000000000000000000000000000000000000000000000;
+        require(unresolved_40ee8d4a, CustomError_dac10e2e());
+        require(!(block.timestamp > unresolved_40ee8d4a), CustomError_dac10e2e());
+        var_a = 0xdac10e2e00000000000000000000000000000000000000000000000000000000;
+        require((unresolved_94c7edfd >> 0x01) > arg0, CustomError_e92c469f());
         var_a = 0xe92c469f00000000000000000000000000000000000000000000000000000000;
         var_b = 0x23b872dd00000000000000000000000000000000000000000000000000000000;
         address var_c = msg.sender;
         address var_d = address(this);
         uint256 var_e = arg0;
         (bool success, bytes memory ret0) = address(0).Unresolved_23b872dd(var_c); // call
-        require(!0, CustomError_045c4b02());
-        unresolved_1aa7c0ec = (uint96(unresolved_1aa7c0ec)) | msg.sender;
-        require(block.timestamp > (block.timestamp + 0x012c), CustomError_045c4b02());
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        require(!0, CustomError_b1b7848f());
+        unresolved_183a7a1d = (uint96(unresolved_183a7a1d)) | msg.sender;
+        require(block.timestamp > (block.timestamp + 0x012c), CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_f = 0x11;
-        executionDeadline = block.timestamp + 0x012c;
-        bondAmount = arg0;
+        unresolved_40ee8d4a = block.timestamp + 0x012c;
+        store_e = arg0;
         var_a = 0x045c4b0200000000000000000000000000000000000000000000000000000000;
-        require(0x20 > ret0.length);
-        require(((var_g + 0x20) > 0xffffffffffffffff) | ((var_g + 0x20) < var_g));
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        require(0x20 > ret0.length, CustomError_b1b7848f());
+        require(((var_g + 0x20) > 0xffffffffffffffff) | ((var_g + 0x20) < var_g), CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_f = 0x41;
         uint256 var_g = var_g + 0x20;
         require(((var_g + 0x20) - var_g) < 0x20);
         require(var_g.length - var_g.length, CustomError_045c4b02());
         require(!var_g.length, CustomError_045c4b02());
         var_a = 0x045c4b0200000000000000000000000000000000000000000000000000000000;
-        var_a = 0x2479328900000000000000000000000000000000000000000000000000000000;
-        var_a = 0xd5ef09ba00000000000000000000000000000000000000000000000000000000;
-        require(currentRewardAmount > (currentRewardAmount + bondAmount), CustomError_9cbc1de1());
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        var_a = 0x2a10f64600000000000000000000000000000000000000000000000000000000;
+        require(unresolved_94c7edfd > (unresolved_94c7edfd + store_e), CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_f = 0x11;
-        currentRewardAmount = currentRewardAmount + bondAmount;
-        require(totalBondsDeposited > (totalBondsDeposited + bondAmount), CustomError_9cbc1de1());
-        var_a = 0x4e487b7100000000000000000000000000000000000000000000000000000000;
+        unresolved_94c7edfd = unresolved_94c7edfd + store_e;
+        require(store_j > (store_j + store_e), CustomError_b1b7848f());
+        var_a = 0xb1b7848f00000000000000000000000000000000000000000000000000000000;
         var_f = 0x11;
-        totalBondsDeposited = totalBondsDeposited + bondAmount;
-        require(executionDeadline, CustomError_9cbc1de1());
-        require(!(block.timestamp > executionDeadline), CustomError_9cbc1de1());
+        store_j = store_j + store_e;
+        require(unresolved_40ee8d4a, CustomError_9cbc1de1());
+        require(!(block.timestamp > unresolved_40ee8d4a), CustomError_9cbc1de1());
         var_a = 0x9cbc1de100000000000000000000000000000000000000000000000000000000;
-        if (executionDeadline) {
+        if (unresolved_40ee8d4a) {
         }
     }

─── Added: Unresolved_5511d69c (0x5511d69c) ───
@@ -1,0 +1,12 @@
+    
+    /// @custom:selector    0x5511d69c
+    /// @custom:signature   Unresolved_5511d69c(uint256 arg0) public pure returns (uint256)
+    /// @param              arg0 ["uint256", "bytes32", "int256"]
+    function Unresolved_5511d69c(uint256 arg0) public pure returns (uint256) {
+        require(0x55 == msg.data[0]);
+        require(0 == 0x01);
+        require(msg.value);
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
+        uint256 var_a = 0;
+        return 0;
+    }

─── Added: Unresolved_fe4d0532 (0xfe4d0532) ───
@@ -1,0 +1,12 @@
+    
+    /// @custom:selector    0xfe4d0532
+    /// @custom:signature   Unresolved_fe4d0532(uint256 arg0) public view returns (uint256)
+    /// @param              arg0 ["uint256", "bytes32", "int256"]
+    function Unresolved_fe4d0532(uint256 arg0) public view returns (uint256) {
+        require(0xfe == msg.data[0]);
+        require(0 == 0x01);
+        require(msg.value);
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
+        var_a = store_j;
+        return store_j;
+    }

─── Added: Unresolved_9995c07e (0x9995c07e) ───
@@ -1,0 +1,12 @@
+    
+    /// @custom:selector    0x9995c07e
+    /// @custom:signature   Unresolved_9995c07e(uint256 arg0) public view returns (address)
+    /// @param              arg0 ["uint256", "bytes32", "int256"]
+    function Unresolved_9995c07e(uint256 arg0) public view returns (address) {
+        require(0xc0 == msg.data[0]);
+        require(0 == 0x01);
+        require(msg.value);
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
+        address var_a = address(unresolved_183a7a1d);
+        return address(unresolved_183a7a1d);
+    }

─── Added: Unresolved_92cc2324 (0x92cc2324) ───
@@ -1,0 +1,12 @@
+    
+    /// @custom:selector    0x92cc2324
+    /// @custom:signature   Unresolved_92cc2324(uint256 arg0) public view returns (uint256)
+    /// @param              arg0 ["uint256", "bytes32", "int256"]
+    function Unresolved_92cc2324(uint256 arg0) public view returns (uint256) {
+        require(0x23 == msg.data[0]);
+        require(0 == 0x01);
+        require(msg.value);
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
+        var_a = store_e;
+        return store_e;
+    }

─── Added: Unresolved_30eed1d9 (0x30eed1d9) ───
@@ -1,0 +1,11 @@
+    /// @custom:selector    0x30eed1d9
+    /// @custom:signature   Unresolved_30eed1d9(uint256 arg0) public view returns (bool)
+    /// @param              arg0 ["uint256", "bytes32", "int256"]
+    function Unresolved_30eed1d9(uint256 arg0) public view returns (bool) {
+        require(0x30 == msg.data[0]);
+        require(0 == 0x01);
+        require(msg.value);
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
+        bytes1 var_a = !(!bytes1(unresolved_df4cc90b));
+        return !(!bytes1(unresolved_df4cc90b));
+    }

─── Added: Unresolved_862d5a3a (0x862d5a3a) ───
@@ -1,0 +1,12 @@
+    
+    /// @custom:selector    0x862d5a3a
+    /// @custom:signature   Unresolved_862d5a3a(uint256 arg0) public pure returns (uint256)
+    /// @param              arg0 ["uint256", "bytes32", "int256"]
+    function Unresolved_862d5a3a(uint256 arg0) public pure returns (uint256) {
+        require(0x86 == msg.data[0]);
+        require(0 == 0x01);
+        require(msg.value);
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
+        uint256 var_a = 0;
+        return 0;
+    }

─── Added: Unresolved_b427a3b4 (0xb427a3b4) ───
@@ -1,0 +1,11 @@
+    
+    /// @custom:selector    0xb427a3b4
+    /// @custom:signature   Unresolved_b427a3b4() public view returns (uint256)
+    function Unresolved_b427a3b4() public view returns (uint256) {
+        require(!store_m);
+        require(0 == 0x01);
+        require(msg.value);
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
+        uint256 var_a = 0;
+        return 0;
+    }

─── Added: Unresolved_df933c99 (0xdf933c99) ───
@@ -1,0 +1,11 @@
+    
+    /// @custom:selector    0xdf933c99
+    /// @custom:signature   Unresolved_df933c99() public view returns (uint256)
+    function Unresolved_df933c99() public view returns (uint256) {
+        require(!store_i);
+        require(0 == 0x01);
+        require(msg.value);
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
+        var_a = 0x0100;
+        return 0x0100;
+    }

─── Added: Unresolved_cbf20774 (0xcbf20774) ───
@@ -1,0 +1,16 @@
+    
+    /// @custom:selector    0xcbf20774
+    /// @custom:signature   Unresolved_cbf20774(uint256 arg0) public view returns (bool)
+    /// @param              arg0 ["uint256", "bytes32", "int256"]
+    function Unresolved_cbf20774(uint256 arg0) public view returns (bool) {
+        require(0xcb == msg.data[0]);
+        require(0 == 0x01);
+        require(msg.value);
+        require((0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc + msg.data.length) < 0);
+        if (unresolved_40ee8d4a) {
+            uint256 var_a = !(block.timestamp > unresolved_40ee8d4a);
+            return !(block.timestamp > unresolved_40ee8d4a);
+            var_a = unresolved_40ee8d4a;
+            return unresolved_40ee8d4a;
+        }
+    }

Commit ebbd4f6

Copy link
Copy Markdown
Member Author

Description

  • exact boundaries: treats the complete caller-supplied runtime as authoritative and classifies every following byte as constructor arguments without ABI, address-shape, or padding heuristics
  • argument masking: XOR-masks every 32-byte constructor chunk using seed-derived masks, shuffled chunk order, and the existing arithmetic-chain generator
  • init decoding: injects a seed-varied init-code trampoline and decoder that restores arguments in memory before replaying the displaced constructor instructions
  • safe reassembly: distinguishes deployed auxdata from transaction-only arguments, patches runtime copy/return sizes and Solidity creation-length constants, and fails closed when lowering is unsafe
  • size enforcement: rejects output exceeding the EIP-170 deployed-runtime or EIP-3860 initcode limits
  • CLI support: accepts either a complete creation payload or --constructor-args <HEX> and reports argument/decoder metrics in result metadata
  • fuzz coverage: extends the built-in fuzzer with randomized constructor values and field-level plaintext-survival checks
  • documentation: adds an executive report, technical design, security boundary, rollout guidance, and before/after benchmarks

Validation

  • 105 core, transform, and CLI tests passed
  • 64 randomized argument/seed/length differential cases produced byte-for-byte identical deployed runtimes, including a 704-byte suffix and partial final words
  • 1,000-case parallel REVM fuzz campaign completed with 1,000 successes, 0 errors, 0 deployment mismatches, and 0 crashes
  • complete constructor suffixes and each nonzero address/amount ABI word were absent from transformed creation payloads
  • deterministic output for equal seeds and variant output for distinct seeds
  • cargo clippy --all-targets -- -D warnings, formatting, and diff checks passed

Benchmark

For the Solidity 0.8.30 ERC20 escrow with a 160-byte constructor suffix:

Metric Before After Delta
Creation payload 9,129 B 9,700 B +571 B (+6.26%)
REVM deployment gas 1,861,722 1,869,364 +7,642 (+0.410%)
Intrinsic calldata gas 139,224 146,608 +7,384 (+5.30%)
Deployed runtime baseline byte-for-byte identical 0 B

Across 100 deterministic seeds, decoder size averaged 569.7 bytes (433–711 bytes), and masking averaged 124.1 µs per creation payload in release mode.

Security boundary

This closes the report's literal ABI-tail extraction path without changing the input Solidity or original creation bytecode. It is deliberately obfuscation rather than encryption: public init code can still be executed or symbolically reversed, and values later exposed through runtime code, storage, logs, calls, or proofs remain public. This PR does not obfuscate runtime transaction arguments or MPT-proof calldata beyond the existing four-byte selector mapping, and it does not address the Solidity CBOR metadata fingerprint.

The full report is available in docs/constructor-argument-obfuscation.md.

Notes:

  • the transform is automatic when an exact constructor suffix exists
  • missing, duplicate, ambiguous, or unsupported layouts fail closed rather than returning plaintext arguments
  • the full workspace verification crate additionally requires the external z3.h development header; the changed core/transform/CLI crates test cleanly

@g4titanx
g4titanx merged commit 6634a27 into master Aug 6, 2026
4 checks passed
@g4titanx
g4titanx deleted the fix/constructor-argument-obfuscation branch August 6, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants